//
//  WalletTopView.swift
//  TianTianBiTing
//
//  Created by Gox mac 2 on 2019/1/3.
//  Copyright © 2019 Gox_WallyDiao. All rights reserved.
//

import UIKit

class WalletTopView: UIView {
    @IBOutlet weak var leftLabel: UILabel!
    @IBOutlet weak var rightlabel: UILabel!
    @IBAction func leftBtnAction(_ sender: Any) {
        
    }
    @IBAction func rightBtnAction(_ sender: Any) {
//        TTAlertView.ask(title: nil, question: "奖励金提现，请前去小程序！", leftTitle: "取消", rightTitle: "立即前去", okBlock: {
//            let launchMiniProgramReq = WXLaunchMiniProgramReq.object()
//            launchMiniProgramReq?.userName = WxUserName
//            launchMiniProgramReq?.path = WxWalletPath
//            launchMiniProgramReq?.miniProgramType = .release
//            WXApi.send(launchMiniProgramReq)
//        }, noBlock: {
//
//        })
//        TTAlertView.showMessage(message: "收听奖励听币！", second: 2)
        let vc = TBWithdrawVc()
//        vc.numStr = self.rightlabel.text ?? "0.00"
        PUSHVIEWCONTROLLER(vc)
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
    }
    
    var contentView:UIView!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        contentView = loadXib()
        contentView.frame = frame
        addSubview(contentView)
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        contentView = loadXib()
        addSubview(contentView)
        
    }
    
    func loadXib() ->UIView {
        let className = type(of:self)
        let bundle = Bundle(for:className)
        let name = NSStringFromClass(className).components(separatedBy: ".").last
        let nib = UINib(nibName: name!, bundle: bundle)
        let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
        
        return view
    }

}
